#include <iostream>
using namespace std;
class A
{
    private:
    int _year,_month,_day;
    public:
    //构造函数
    A(int year,int month,int day)
    {
        _year=year;
        _month=month;
        _day=day;
    }
    //拷贝构造
    A(const A& d)
    {
        _year=d._year;
        _month=d._month;
        _day=d._day;
    }
    int Getmonthday(int year,int month)
    {
        int Month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
        if(month==2&&((year%4==0&&year%100!=0)||(year%400==0)))
        {
            return 29;
        }
        return Month[month];
    }
    bool operator==(const A& d)
    {
        return _year==d._year&&_month==d._month&&_day==d._day;
    }
    bool operator!=(const A& d)
    {
        return !(*this==d);
    }
    bool operator<(const A& d)
    {
        if(_year<d._year)
        {
            return true;
        }
        else if(_year==d._year)
        {
            if(_month<d._month)
            {
                return true;
            }
            else if(_day<d._day)
            {
                return true;
            }
        }
        return false;
    }
    A& operator-=(int day)
  {
	_day -= day;
	while (_day <= 0)
	{
		_month--;
		if (_month == 0)
		{
			_year--;
			_month = 12;
		}
		_day += Getmonthday(_year, _month);
	}
	return *this;
 }
    A operator--(int)
   {
	A tmp = *this;
	*this -= 1;
	return tmp;
   }
    int operator-(const A& d)
    {
       int flag=1;
       A max=*this;
       A min=d;
       if(max<min)
       {
         max=d;
         min=*this;
         flag=-1;
       }
       int n;
       while(max!=min)
       {
         max--;
         n++;
       }
       return flag * n;
    }
};
int main() {
    int year, month, day;
    cin>>year>>month>>day;
    A a1(year,month,day);
    A a2(year,1,1);
    int ret=a1-a2+1;
   cout<< ret<<endl;
    return 0;
}